package divideAndConquer;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class MultiplicationOfLargeIntegers {
    
    /*
    
    两个大整数X,Y相乘，如X = 7984, Y = 8796，直接相乘要进行4*5步即O(n^2)步才能算出结果
    令A = 79, B = 84; C = 87, D = 96; m是X的位数长度，这里m = 4, n则是Y的位数长度, n = 4，下面代换过程必须满足m == n
    X = A*10^(m/2) + B, Y = C*10^(n/2) + D
    X * Y = A*C * 10^n + (A*D + C*B) * 10^(n/2) + B*D
    = A*C * 10^n + ((A-B)*(D-C) + A*C + B*D) * 10^(n/2) + B*D
    此时只需计算A*C与B*D只需要进行2*2+2*3步即((n/2)*(n/2))步就能算出结果
    
     */
    static InOut0 io = new InOut0();
    String strX, strY;
    long a, b, c, d;
    long result;
    int count;
    public MultiplicationOfLargeIntegers() {
        strX = io.next();
        strY = io.next();
        if (strX.length() == strY.length()) {
            int length = strX.length();
            while (length > 3) {
                length /= 2;
                count++;
            }
            length = strX.length();
            result = recursion(strX, strY);
        } else {
            throw new NumberFormatException("x = " + strX + ", y = " + strY);
        }
        
    }
    public long recursion(String strX, String strY) {
        if (count > 0) {
            a = Long.parseLong(strX.substring(0, strX.length()/2));
            b = Long.parseLong(strX.substring(strX.length()/2, strX.length()));
            c = Long.parseLong(strY.substring(0, strY.length()/2));
            d = Long.parseLong(strY.substring(strY.length()/2, strY.length()));
            count--;
            long ac = recursion(a+"", c+"");
            long bd = recursion(b+"", d+"");
            return ac * (long) Math.pow(10, strX.length()) + ((a-b)*(d-c) + ac + bd) * (long) Math.pow(10, strX.length()/2) + bd;
        } else {
            return Integer.parseInt(strY) * Integer.parseInt(strY);
        }
    }
    
    public static void main(String[] args) throws IOException {
        // TODO Auto-generated method stub
        MultiplicationOfLargeIntegers m = new MultiplicationOfLargeIntegers();
        io.out.println(m.result);
        io.out.flush();
    }

}
class InOut0 {
    BufferedReader br;
    StringTokenizer tok;
    PrintWriter out;
    public InOut0() {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new OutputStreamWriter(System.out));
    }
    public boolean hasNext() {
        while (tok == null || !tok.hasMoreElements()) {
            try {
                tok = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                // TODO Auto-generated catch block
                return false;
            }
        }
        return true;
    }
    public String next() {
        if (hasNext()) {
            return tok.nextToken();
        }
        return null;
    }
}

